home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2002 #11 / Amiga Plus CD - 2002 - No. 11.iso / Tools / MorphOS / Epic4_mos / share / epic / script / deban < prev    next >
Encoding:
Text File  |  2002-10-28  |  1.2 KB  |  73 lines

  1. /*
  2.  * ban removers, 1993, 1997
  3.  * This script requires ircII-EPIC4.
  4.  */
  5.  
  6. # returns non-0 if $0 matches or is matched by $1-, 0 if not.
  7. alias comatch @ function_return = (match($*) || rmatch($*))
  8.  
  9. alias deban_mode 
  10. {
  11.         fe ($*) bx by bz {
  12.                 @ :moder = bz?[-bbb]:by?[-bb]:bx?[-b]:[]
  13.                 if (moder) {
  14.                         mode * $moder $bx $by $bz
  15.                 }
  16.         }
  17. }
  18.  
  19. # remove all bans on current channel
  20. alias deban uniban *
  21.  
  22. # remove all bans that could cover nickname
  23. alias unban uniban $0!$uh($0)
  24.  
  25. # remove all bans matching or matched by pattern
  26. alias uniban 
  27. {
  28.     local unbanlist
  29.     local p $0
  30.  
  31.     stack push on 367
  32.     stack push on 368
  33.         ^on ^367 * {
  34.         bless
  35.         if (comatch($2 $p)) 
  36.             { push unbanlist $2 }
  37.     }
  38.         ^on ^368 * {
  39.         bless
  40.         stack pop on 367
  41.         stack pop on 368
  42.         deban_mode $unbanlist
  43.     }
  44.         ^mode ${[$1]?[$1]:C} +b
  45.     wait
  46. }
  47.  
  48.  
  49. # remove all bans that contain a literal text substring
  50. alias nban 
  51. {
  52.     local unbanlist
  53.     local p $0
  54.     stack push on 367
  55.     stack push on 368
  56.  
  57.         ^on ^367 * {
  58.         bless
  59.         if (rmatch($2 *$p*))
  60.             { push unbanlist $2 }
  61.     }
  62.     ^on ^368 * {
  63.         bless
  64.         stack pop on 367
  65.         stack pop on 368
  66.         deban_mode $unbanlist
  67.     }
  68.         ^mode ${[$1]?[$1]:C} +b
  69.     wait
  70. }
  71.  
  72. #hop'93
  73.